package com.nh.springdeal.controller;

import com.nh.springdeal.req.UsersSaveReq;
import com.nh.springdeal.resp.CommonResp;
import com.nh.springdeal.service.IUsersService;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UsersController {

@PostMapping("register")
    public CommonResp  register(@RequestBody UsersSaveReq req){
       req.setPassword(DigestUtils.md5DigestAsHex(req.getPassword().getBytes()));
       CommonResp resp  = new CommonResp<>();
    return resp;
}
}
